package com.ssy.lingxi.pay.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.pay.api.dto.request.assetAccount.*;
import com.ssy.lingxi.pay.api.fallback.AssetAccountHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 资金账户内部接口
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/9/24
 */
@FeignClient(value = "pay-service", fallback = AssetAccountHystrix.class)
public interface IAssetAccountFeign {

    /**
     * 新增会员资金账户
     * @param memberAssetAccountRequestList 会员资金账户实体
     */
    @RequestMapping(value = "/pay/synchAssetAccount/saveMemberAssetAccount", method = RequestMethod.POST)
    Wrapper<String> saveMemberAssetAccount(@RequestBody List<MemberAssetAccountAddRequest> memberAssetAccountRequestList);

    /**
     * 修改会员资金账户状态
     * @param memberAssetAccountUpdateRequest 会员资金账户实体
     */
    @RequestMapping(value = "/pay/synchAssetAccount/updateMemberAssetAccount", method = RequestMethod.POST)
    Wrapper<String> updateMemberAssetAccount(@RequestBody MemberAssetAccountUpdateRequest memberAssetAccountUpdateRequest);

    /**
     * 余额支付
     * @param balancePayRequest 参数
     */
    @RequestMapping(value = "/pay/assetAccount/balancePay", method = RequestMethod.POST)
    Wrapper<String> balancePay(@RequestBody BalancePayRequest balancePayRequest);

    /**
     * 余额返现
     * @param balanceCashbackRequest 参数
     */
    @RequestMapping(value = "/pay/assetAccount/balanceCashback", method = RequestMethod.POST)
    Wrapper<String> balanceCashback(@RequestBody BalanceCashbackRequest balanceCashbackRequest);

    /**
     * 余额退款
     * @param balanceRefundRequest 参数
     */
    @RequestMapping(value = "/pay/assetAccount/balanceRefund", method = RequestMethod.POST)
    Wrapper<Boolean> balanceRefund(@RequestBody BalanceRefundRequest balanceRefundRequest);
}
